<template>
  <div id="app">
    <!-- 页面是否需要缓存 -->
    <keep-alive>
      <router-view v-if="$route.meta.keepAlive"/>
    </keep-alive>

    <router-view v-if="!$route.meta.keepAlive"></router-view>
    <loading></loading>
  </div>
</template>

<script>
import loading from '@/components/loading';
export default {
  name: "App",
  components:{
    loading
  },
  data() {
    return {};
  },
  mounted() {
    const userInfo ={
      uid:199661,
    mobile: 18819490360,
    token: "3f3a7fc5f0d42167d74d5ee0e209f91b3409ab912d11a28ae47f57db4b7c22c6"
    }
    this.appJS.setStorage('userInfo',userInfo)
    // 检测用户是否有店铺
    this.appJS.ajax('user.check_member_has_store','post',{
      member_id:this.appJS.getStorage('userInfo').uid
    },res=>{
      if(res.recode==1){
        if(res.data.store_id!=''){
          this.$router.push({path:'/User',query:{store_id:res.data.store_id}})
        }
      }
    })
  }
};
</script>

<style lang="less">
@import "./assets/iconfont/icon.css";
@import "./assets/css/animate.css";
html,body,#app {
  background: rgb(248, 248, 248) !important;
      max-width: @maxWidth;
      margin: 0 auto;
}
.container {
  padding-top: 59px;
}
</style>
